<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
</body>
<script>
  let price = 24.51
  console.log(/\d/.test(price))//true
  // . 除换行外任意字符  普通点   优先级问题   \d+  一个或多个d
  console.log(/\d+\.\d+/.test(price))//true

  let url = 'https://www.baidu.com'
  //?代表s可有可无  \w+表示多个字母下划线  \.为转义转为普通点
  console.log(/https?:\/\/\w+\.\w+\.\w+/.test(url))

</script>
</html>